package com.atguigu.jxc.dao;

import com.atguigu.jxc.entity.SaleList;
import com.atguigu.jxc.entity.SaleListGoods;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface SaleDao {
    
    //保存销售单
    void saveSaleList(SaleList saleList);


    void saveSaleListGoods(@Param("sale") SaleListGoods sale,
                               @Param("price") Integer price,
                               @Param("total") Integer total);

    List<SaleList> getSaleList(@Param("saleNumber") String saleNumber,
                                       @Param("customerId") Integer customerId,
                                       @Param("state") Integer state,
                                       @Param("sTime") String sTime,
                                       @Param("eTime") String eTime);

    void SaleDeleteGoods(Integer saleListId);

    void SaleDelete(Integer saleListId);

    void updateState(Integer saleListId);

    List<SaleListGoods> getSaleListGoods(Integer saleListId);

    List<SaleList> getSaleCount(@Param("sTime") String sTime,
                            @Param("eTime") String eTime,
                            @Param("goodsTypeId") Integer goodsTypeId,
                            @Param("codeOrName") String codeOrName);

    List<Map<String, Object>> getSaleDataByDay(@Param("sTime") String sTime,
                                               @Param("eTime") String eTime);

    List<Map<String, Object>> getSaleDataByMonth(@Param("sTime") String sTime,
                                                 @Param("eTime") String eTime);
}
